package cn.lucky.springcloud.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @author lingpeng.jiang
 * @create 2020-12-10-21:05
 */
@RestController
@RequestMapping("/consumerzk")
public class ConsumerController {


    @Autowired
    private RestTemplate restTemplate;

    public static final String PAYMENT_URL = "http://cloud-payment-service";

    @GetMapping("/getPayment/zk")
    public String getPaymentData(){
        return restTemplate.getForObject(PAYMENT_URL + "/payment/zk",String.class);
    }
}
